﻿using System.Xml;
using System.Xml.Serialization;
using System;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Schema;


namespace ScormModel
{
    [Serializable()]
    public class RollupCondition
    {
        private string _operator;
        private string _condition;
         [NonSerialized]
        private XmlNode _rollupConditionContent;
        [XmlAttribute("operator")]
        public string Operator
        {
            get { return this._operator; }
            set { this._operator = value; }
        }
        [XmlAttribute("condition")]
        public string Condition
        {
            get { return this._condition; }
            set { this._condition = value; }
        }
        
        [XmlIgnoreAttribute]
        public XmlNode RollupConditionContent
        {
            get { return this._rollupConditionContent; }
            set { this._rollupConditionContent = value; }
        }
        public void buildRollupCondition()
        {
            XmlAttributeCollection attList = _rollupConditionContent.Attributes;
            if (attList.GetNamedItem("condition") != null)
            {
                _condition = ((XmlAttribute)attList.GetNamedItem("condition")).Value;
            }
            if (attList.GetNamedItem("operator") != null)
            {
                _operator = ((XmlAttribute)attList.GetNamedItem("operator")).Value;
            }
        }
    }
}
